package login

import (
	"base"
	. "center_server/logic/internal"
	"leaf/gate"
	"proto/server/login"
)

type loginService struct {
}

func init() {
	service := new(loginService)
	Protocol.Register(new(proto_server_login.OnLogin), service.onLogin)
}

func (*loginService) onLogin(args []interface{}) {
	msg := args[0].(*proto_server_login.OnLogin)
	base.Logger.Release("login service on login, %s", msg)

	agent := args[1].(gate.Agent)
	server := agent.UserData().(*loginServer)

	system.onLogin(server, msg)
}
